package com.jrx.anytxn.reporting.job.payment.step;

import com.jrx.anytxn.param.entity.PrOrganizationTable;
import com.jrx.anytxn.reporting.constant.ReportingConstant;
import com.jrx.anytxn.transaction.entity.TlPaymentLog;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.batch.MyBatisPagingItemReader;
import java.util.HashMap;
import java.util.Map;

public class AutoAssemPaymentLogReader extends MyBatisPagingItemReader<TlPaymentLog> {

    public AutoAssemPaymentLogReader(SqlSessionFactory sqlSessionFactory, Integer pageSize, PrOrganizationTable org){
        setSaveState(false);
        setPageSize(pageSize);
        setSqlSessionFactory(sqlSessionFactory);
        setQueryId("com.jrx.anytxn.transaction.mapper.ext.ExtTlPaymentLogMapper.selectByCollateDate");
        Map<String,Object> map = new HashMap<>();
        map.put("collateDate",org.getToday());
        map.put("sumStatus", ReportingConstant.DISBURSEMENT_LOG_SUM_STATUS_S);
        setParameterValues(map);
    }

}
